package cn.taketoday.live.thread.online;

import cn.taketoday.live.config.GlobalData;
import cn.taketoday.live.http.HttpHeartBeatData;

/**
 * @author BanqiJane
 * @ClassName HeartBeatsThread
 * @Description TODO
 * @date 2020年8月10日 下午12:29:59
 * @Copyright:2020 blogs.acproject.xyz Inc. All rights reserved.
 */
public class HeartBeatsThread extends Thread {
  //	private static Logger LOGGER = LogManager.getLogger(HeartBeatsThread.class);
  public volatile boolean FLAG = false;

  @Override
  public void run() {
    super.run();
    while (!FLAG) {
      if (FLAG) {
        return;
      }
      if (GlobalData.USER == null) {
        return;
      }
      HttpHeartBeatData.httpGetHeartBeatOrS(System.currentTimeMillis());
      try {
        Thread.sleep(300 * 1000);
      }
      catch (InterruptedException e) {
        // TODO 自动生成的 catch 块
//				e.printStackTrace();
//				LOGGER.debug("在线心跳线程5m关闭:"+e);
      }
    }
  }
}
